<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>4.6 *图案</title>
</head>

<body>
    <script>
        for (var i = 0; i < 5; i++) {
            for (var j = 0; j < (4 - i); j++) {
                document.write('&nbsp;')            
            }
            for (var k = 0; k <= i; k++) {
                document.write('* ');             
            }
            document.write('<br>');
        }
       
    </script>
</body>

</html>